package per.com.controller.portal;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import per.com.bean.Comment;
import per.com.common.ServerResponse;
import per.com.service.ICommentService;
import per.com.vo.CommentDetailVo;

/**
 * @author zxy
 */
@RequestMapping(value = "/comment/")
@ResponseBody
@Controller
public class CommentController {

    @Autowired
    private ICommentService iCommentService;

    /**
     * 添加评论
     * @param comment
     * @return
     */
    @RequestMapping(value = "add_comment" , method = RequestMethod.POST)
    public ServerResponse<CommentDetailVo> addComment(Comment comment){
        return iCommentService.addComment(comment);
    }

    /**
     * 获取到一条评论
     * @param id
     * @return
     */
    @RequestMapping(value = "select_comment" , method = RequestMethod.POST)
    public ServerResponse<CommentDetailVo> selectComment(String id){
        return iCommentService.selectComment(id);
    }
}
